package com.nondo.rdp.finance.service.impl.setting.home;

import com.nondo.rdp.finance.domain.setting.home.SettingModuleEducation;
import com.nondo.rdp.finance.repository.setting.home.SettingModuleEducationRepository;
import com.nondo.rdp.finance.service.setting.home.SettingModuleEducationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class SettingModuleEducationServiceImpl implements SettingModuleEducationService {
    @Autowired
    SettingModuleEducationRepository settingModuleEducationRepository;

    @Override
    public SettingModuleEducation findOne(Long id) {
        return this.settingModuleEducationRepository.findOne(id);
    }

    @Override
    public SettingModuleEducation save(SettingModuleEducation settingModuleEducation) {
        return this.settingModuleEducationRepository.save(settingModuleEducation);
    }

    @Override
    public void update(SettingModuleEducation settingModuleEducation) {
        this.settingModuleEducationRepository.save(settingModuleEducation);
    }

    @Override
    public void delete(Long id) {
        this.settingModuleEducationRepository.deleteById(id);
    }

    @Override
    public List<SettingModuleEducation> findAll(Sort sort) {
        return this.settingModuleEducationRepository.findAllByDelFlag("0", sort);
    }
}